package com.qiuling.iot.utils;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.time.Duration;

/**
 * @Author：zhangqiang
 * @Description：初始化jwt参数设置
 * @Date：Created in 22:39 2020/2/9
 * @Modified By：
 */
@Component
@Data
@PropertySource("classpath:config.properties")
public class TokenSettings {

    /**
     * 这些值配置在注解所示的配置文件里，可自信个修改
     * 程序启动时初始化bean时注入值
     */
    @Value("${jwt.secretKey}")
    private String secretKey;

    @Value("${jwt.accessTokenExpireTime}")
    private Duration accessTokenExpireTime;

    @Value("${jwt.refreshTokenExpireTime}")
    private Duration refreshTokenExpireTime;

    @Value("${jwt.refreshTokenExpireAppTime}")
    private Duration refreshTokenExpireAppTime;

    @Value("${jwt.issuer}")
    private String issuer;
}
